/*
 * TextField.java
 *
 * Created on 30 de agosto de 2007, 04:41 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package ig.formato.util;

/**
 *
 * @author jsanchez
 */
public class Field implements Comparable {

    private String text = null;
    private String classs = null;
    private Integer banda = null;
    private Integer idice = null;
    private boolean xpath = false;

    public Integer getIdice() {
        return idice;
    }

    public void setIdice(Integer idice) {
        this.idice = idice;
    }

    /** Creates a new instance of TextField */
    public Field() {
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getClasss() {
        return classs;
    }

    public void setClasss(String classs) {
        this.classs = classs;
    }

    public Integer getBanda() {
        return banda;
    }

    public void setBanda(Integer banda) {
        this.banda = banda;
    }

    public int compareTo(Object o) {
        return this.getIdice().compareTo(((Field) o).getIdice());
    }

    public boolean isXpath() {
        return xpath;
    }

    public void setXpath(boolean xpath) {
        this.xpath = xpath;
    }

    @Override
    public String toString() {
        //if (xpath) {
        //   return "<field name=\"" + this.text + "\" class=\"" + this.classs + "\">\n" +
        //           "   <fieldDescription><![CDATA[@" + this.text + "]]></fieldDescription>\n" +
        //            "</field>";
        //} else {
            return "<field name=\"" + this.text + "\" class=\"" + this.classs + "\"/>";
        //}
    }
}